﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Serilog;
using WebApplicationDemo.Model;

namespace WebApplicationDemo.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class HomeController : ControllerBase
    {
        private readonly ILogger _logger;

        public HomeController(ILogger logger)
        {
            _logger = logger.ForContext(typeof(HomeController));
        }

        [HttpGet(Name = "Home2")]
        public string Get(string testData)
        {
            _logger.Information("test");
            throw new Exception("test");
            return "";
        }

        [HttpPost(Name = "Home3")]

        public string Post(LoginModel loginModel)
        {
            throw new Exception("test");
            return "";
        }

        [HttpPost("test", Name = "Home1")]

        public string Post([FromForm] string test, [FromForm]int num)
        {
            throw new Exception("test");
            return "";
        }
    }
}
